Views [dbo].[vInKindGifts]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Created3:38:37 PM Friday, January 07, 2011
Last Modified1:48:52 PM Thursday, September 22, 2011
Columns
Name
ID
GIFT_AMOUNT
Permissions
TypeActionOwning Principal
GrantDeleteIMIS
GrantInsertIMIS
GrantReferencesIMIS
GrantSelectIMIS
GrantUpdateIMIS
SQL Script
create  view vInKindGifts as
   select t.BT_ID as ID,
          sum(t.INVOICE_CREDITS) as GIFT_AMOUNT
   from Trans t, Invoice i, Cash_Accounts c
   where t.INVOICE_REFERENCE_NUM = i.REFERENCE_NUM and
         i.SOURCE_SYSTEM = 'FR' and
         t.CHECK_NUMBER = c.CASH_ACCOUNT_CODE and
         c.ACCOUNT_TYPE= 2 and
         ((t.JOURNAL_TYPE = 'PAY' and t.TRANSACTION_TYPE = 'AR') or
             (t.JOURNAL_TYPE = 'IN' and t.TRANSACTION_TYPE = 'PAY'))
  group by t.BT_ID

GO
GRANT REFERENCES ON  [dbo].[vInKindGifts] TO [IMIS]
GRANT SELECT ON  [dbo].[vInKindGifts] TO [IMIS]
GRANT INSERT ON  [dbo].[vInKindGifts] TO [IMIS]
GRANT DELETE ON  [dbo].[vInKindGifts] TO [IMIS]
GRANT UPDATE ON  [dbo].[vInKindGifts] TO [IMIS]
GO
Uses